Skip to content

init: the database's password arrives only as a SCRAM-SHA-256 verifier - #18

Merged
jaredLunde merged 1 commit into
mainfrom
scram-verifier-only
Nov 22, 2026
Merged

jaredLunde merged 1 commit into
mainfrom
scram-verifier-only

Conversation

@jaredLunde

Copy link
Copy Markdown
Contributor

The Beyond node now hands this VM a SCRAM-SHA-256 verifier of the superuser password, never the value (beyondoss/beyond, primitive-runtime delivery). init keeps only a value starting with SCRAM-SHA-256$ (env_relay::offer); a plaintext is ignored and init exits after WAIT (fail closed), so no plaintext is held or written to the metadata file.

initdb decision: the pwfile carries the verifier as is, no change to boot.rs. Checked on real postgres:18: initdb --pwfile= stores it verbatim and a login with the original password over SCRAM succeeds; ALTER ROLE postgres WITH PASSWORD $beyond$$beyond$ (every start) also works.

Tests: env_relay unit tests (plaintext never kept) pass. tests/supervisor.rs adds a Docker test (login with the original over SCRAM, wrong fails, stored rolpassword == verifier, no original in /run/mmds or env). It could not run on the homelab: the harness's gosu fails with 'operation not permitted' there, and supervisor_lifecycle_primary fails identically on main.

Merge after the Beyond node change is published: an old driver sending plaintext would hold init until it exits.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc

The Beyond node derives the verifier from the sealed password; init keeps only a value that is one (a plaintext is ignored, so none is ever held or
written). initdb takes the verifier as given and ALTER ROLE sets it every start; clients log in with the original over SCRAM.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpMBitUrzhuG9iHe6RetTc
@jaredLunde
jaredLunde merged commit 516595a into main Nov 22, 2026
1 check failed
@jaredLunde
jaredLunde deleted the scram-verifier-only branch November 22, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant